#include "score_board.h"
#include "ui_score_board.h"

score_board::score_board(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::score_board)
{
    ui->setupUi(this);

    connect(this, &score_board::refresh, this, [this]() {
        ui->userNameDisplayLabel->setText(uname_);
        ui->scoreDisplayLabel->setText(QString::number(score_));
        ui->bombOpenedNumLabel->setText(QString::number(opened_bombs_num_));
        ui->notBombOpenedNumLabel->setText(QString::number(opened_not_bombs_num_));
    });
}

score_board::~score_board()
{
    delete ui;
}
